package com.dmooo.ymx.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.LinearLayout;

import com.dmooo.ymx.R;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * @author wim
 */
public class DialogActivity3 extends Activity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ac_dialog3);
        getWindow().setLayout(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
        ButterKnife.bind(this);
        setFinishOnTouchOutside(false);
        findViewById(R.id.txt_agreement).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                NewsActivity.actionStart(DialogActivity3.this,"1", "用户协议");
            }
        });
        findViewById(R.id.txt_agreement2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                NewsActivity.actionStart(DialogActivity3.this,"48", "隐私政策");
            }
        });
    }

    @OnClick({R.id.txt_cancle, R.id.txt_ok})
    public void onViewClicked(View view) {
        Intent intent=new Intent();
        switch (view.getId()) {
            case R.id.txt_cancle:
                setResult(RESULT_CANCELED,intent);
                finish();
                break;
            case R.id.txt_ok:
                setResult(RESULT_OK,intent);
                finish();
                break;
        }
    }
}
